function test11( c )
%TEST4 Summary of this function goes here
%   Detailed explanation goes here
    
    
    W = imread('../TestImg/storm.png');
    W = double(W(:,:,1));
%     
    W = zeros(c,c);
    for i = 1:c
        for j = 1:2:c
            W(i,j)=1;
        end
    end
    
%     S = [2,4;6,8];
    S = fspecial('motion',10,0);;

    H2 = conv2(W,S);
    
%     H2 = H2.*((0.9999+(1.0001-0.9999)).*rand(size(H2,1),size(H2,2)));
    H2 = H2.*(0.99+(rand(size(H2,1), size(H2,2)).*(1.01-0.99)));
    
%     H2(42,42) = 2*H2(42,42);

    for i = 1:size(H2,1)
        for j = 1:size(H2,2)
            if(H2(i,j) < 0)
                H2(i,j) = 0;
            end
            if(H2(i,j) > 255)
                H2(i,j) = 255;
            end
        end
    end
    
    disp(max(H2(:)));
    
    t = cputime;
%     WRec = MyDeconv2DFFT(H2,S);%.*sum(S(:));
    WRec = MyDeconv2DFast(H2,S,size(W,1),size(W,2),250000,0);
    disp(cputime-t);
    
    
    figure(1); 
    subplot(2,2,1);
    imshow(ZeroToOne(W));
    disp('W');
    %disp(W);
    
    subplot(2,2,2);
    imshow(ZeroToOne(S));
    disp('S');
    %disp(S);
    
    subplot(2,2,3);
    imshow(ZeroToOne(H2));
    disp('H');
%     disp(H);
    
    subplot(2,2,4);
    imshow(ZeroToOne(WRec));
    disp('WRec');
%     disp(WRec);
    
end

function y = NewFullSize(H, m, n)
    [mh,nh] = size(H);
    y = zeros(mh+m-1, nh+n-1);            
    m = ceil(m/2);
    n = ceil(n/2);
    
    y(m:(m+mh-1), n:(n+nh-1) ) = H;
    
    for i = 1:size(y,1)
%         y(i,1:n) = 0;
%         y(i, (n+nh):size(y,2)) = 0;
        y(i,1:n) = y(i,n);
        y(i, (n+nh):size(y,2)) = y(i,(n+nh)-1);
    end
    
    for j = 1:size(y,2)
%         y(1:m, j) = 0;
%         y((m+mh):size(y,1), j) = 0;
        y(1:m, j) = y(m,j);
        y((m+mh):size(y,1), j) = y((m+mh-1),j);
    end
end

